x86/msr: Dispatch Xen and Viridian MSRs from guest_{wr,rd}msr()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 20 Sep 2017 17:33:59 +0000 (18:33 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 24 Sep 2018 15:25:36 +0000 (16:25 +0100)
commitbd7099a674819c0709bd058793adea2e76b42a6b
tree896cf0bba2780b6b3b677b1a788802d16db33fa1
parentcd8015b634b005a3911bd6025351cd854d63a82a
x86/msr: Dispatch Xen and Viridian MSRs from guest_{wr,rd}msr()

Despite the complicated diff in {svm,vmx}_msr_write_intercept(), it is just
the 0 case losing one level of indentation, as part of removing the call to
wrmsr_hypervisor_regs().

The case blocks in guest_{wr,rd}msr() use raw numbers, partly for consistency
with the CPUID side of things, but mainly because this is clearer code to
follow.  In particular, the Xen block may overlap with the Viridian block if
Viridian is not enabled for the domain, and trying to express this with named
literals caused more confusion that it solved.

Future changes with clean up the individual APIs, including allowing these
MSRs to be usable for vcpus other than current (no callers exist with v !=
current).

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/msr.c
xen/arch/x86/pv/emul-priv-op.c